package com.mapbased.wfw.bind;

import com.mapbased.wfw.*;
import com.mapbased.cc.SpringAppContext;
/**
 *
 *
 * <p>Title: </p>
 *
 * <p>Description:get spring bean </p>
 *
 * <p>Copyright: Copyright (c) 2006</p>
 *
 * <p>Company: mapbased.com</p>
 *
 * @author chy_hs(Baily)
 * @version 1.0
 */
public class BeanBinding
    extends AbstractBinding
{
    public BeanBinding(String exp)
    {
        super(exp);
    }

    /**
     * getDirectValue
     *
     * @param context RenderContext
     * @return Object
     * @todo Implement this com.mapbased.wfw.bind.AbstractBinding method
     */
    protected Object getDirectValue(RenderContext rc)
    {
        Object o=rc.global.getAppContext();
        if(o instanceof com.mapbased.cc.SpringAppContext)
        {
            SpringAppContext sac=(SpringAppContext)o;
            return sac.getBean(this.attributeName);

        }
        return null;

    }

    public static void main(String[] args)
    {
    }
}
